package com.tourism.core.cn.enums;

import lombok.Getter;

/*********************************************************************
 Copyright(c) 2024 All Rights Reserved .
 Author : liliang
 CreatedOn : 2024/12/26 22:46
 Email : 2061996582@qq.com
 Describe : TODO
 UseCase :
 Version : 2024|V1.0.0.0
 **********************************************************************/
@Getter
public enum ResultCodeEnum {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),

    // 用户相关错误
    USER_EXIST(1001, "用户名已存在"),
    USER_NOT_EXIST(1002, "用户不存在"),
    PASSWORD_ERROR(1003, "密码错误"),
    MOBILE_EXIST(1004, "手机号已存在"),
    CODE_ERROR(1005, "验证码错误"),
    CODE_EXPIRED(1006, "验证码已过期"),

    // 短信相关错误码
    SMS_SEND_ERROR(2001, "短信发送失败"),
    SMS_CODE_EXPIRED(2002, "验证码已过期"),
    SMS_CODE_ERROR(2003, "验证码错误"),
    SMS_SEND_FREQUENTLY(2004, "发送太频繁，请稍后再试"),

    LOGIN_ERROR(3001, "登录失败，账号或密码错误");

    private final Integer code;
    private final String message;

    ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
